<?php

namespace app\Themes\XiaoSen\widgets;

use Frontend\Assets\AppAsset;
use yii\web\AssetBundle;

class ThemeAsset extends AssetBundle {

  const PUBLISH_DIR = 'theme-xiaosen';

  public $sourcePath = '@app/Themes/XiaoSen/assets/dist';

  public $css = [
      'css/xiaosen.css'
  ];

  public $publishOptions = [
    'publishDir' => self::PUBLISH_DIR ];

  public $depends = [
      AppAsset::class
  ];

  public static function getPublishedImageUrl( $image ) {

    return '/assets/' . self::PUBLISH_DIR . '/images/' . $image;

  }
}